﻿FIND_PATH(SSL_INCLUDE_DIR openssl/ssl.h)
if(WIN32)
  find_library(SSL_LIBRARY_RELEASE NAMES openssl)
  find_library(SSL_LIBRARY_DEBUG NAMES opensslD)
  find_library(EAY_LIBRARY_RELEASE NAMES libeay32)
  find_library(EAY_LIBRARY_DEBUG NAMES libeay32D)
else()
  find_library(SSL_LIBRARY_RELEASE NAMES ssl)
  find_library(EAY_LIBRARY_RELEASE NAMES crypto)
endif()
set(SSL_LIBRARY ${SSL_LIBRARY_RELEASE} ${EAY_LIBRARY_RELEASE})
if(SSL_LIBRARY_DEBUG)
  set(SSL_LIBRARIES
    optimized ${SSL_LIBRARY_RELEASE} debug ${SSL_LIBRARY_DEBUG}
    optimized ${EAY_LIBRARY_RELEASE} debug ${EAY_LIBRARY_DEBUG})
else()
  set(SSL_LIBRARIES ${SSL_LIBRARY})
endif()

if (SSL_INCLUDE_DIR AND SSL_LIBRARY)
  set(SSL_FOUND TRUE)
endif()
